package view;

import controller.HistoricControl;
import entity.SystemM;
import java.util.List;
import javax.swing.JOptionPane;

public class HistoricView extends javax.swing.JFrame {

    /**
     * Creates new form HistoricoView
     */
    public HistoricView() {
        initComponents();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        ReturnButton = new javax.swing.JButton();
        RadioButtonTemperature = new javax.swing.JRadioButton();
        RadioButtonAtmPressure = new javax.swing.JRadioButton();
        RadioButtonPluviosity = new javax.swing.JRadioButton();
        jLabel2 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("URW Bookman L", 3, 15)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(0, 0, 255));
        jLabel1.setText("Histórico de resultados");

        ReturnButton.setText("Volver");
        ReturnButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ReturnButtonActionPerformed(evt);
            }
        });

        RadioButtonTemperature.setText("Temperatura");
        RadioButtonTemperature.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RadioButtonTemperatureActionPerformed(evt);
            }
        });

        RadioButtonAtmPressure.setText("Presión Atmosférica");
        RadioButtonAtmPressure.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RadioButtonAtmPressureActionPerformed(evt);
            }
        });

        RadioButtonPluviosity.setText("Pluviosidad");
        RadioButtonPluviosity.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RadioButtonPluviosityActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("URW Bookman L", 3, 15)); // NOI18N
        jLabel2.setForeground(java.awt.Color.blue);
        jLabel2.setText("Central meteorológica AguasCalientes");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 312, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(73, 73, 73)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(RadioButtonAtmPressure)
                            .addComponent(RadioButtonPluviosity)
                            .addComponent(RadioButtonTemperature)
                            .addComponent(jLabel1)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(137, 137, 137)
                        .addComponent(ReturnButton)))
                .addGap(0, 0, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel1)
                .addGap(29, 29, 29)
                .addComponent(RadioButtonTemperature)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(RadioButtonAtmPressure)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(RadioButtonPluviosity)
                .addGap(29, 29, 29)
                .addComponent(ReturnButton)
                .addContainerGap(66, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void ReturnButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ReturnButtonActionPerformed
        CentralFrame newCentralFrame = new CentralFrame();
        newCentralFrame.setLocationRelativeTo(null);
        newCentralFrame.setVisible(true);
        this.dispose();
    }//GEN-LAST:event_ReturnButtonActionPerformed

    private void RadioButtonTemperatureActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RadioButtonTemperatureActionPerformed
        
        HistoricControl frame = new HistoricControl(1);
        RadioButtonTemperature.setEnabled(false);
        RadioButtonAtmPressure.setEnabled(true);
        RadioButtonPluviosity.setEnabled(true);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }//GEN-LAST:event_RadioButtonTemperatureActionPerformed

    private void RadioButtonAtmPressureActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RadioButtonAtmPressureActionPerformed
     
        HistoricControl frame = new HistoricControl(2);
        RadioButtonTemperature.setEnabled(true);
        RadioButtonAtmPressure.setEnabled(false);
        RadioButtonPluviosity.setEnabled(true);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }//GEN-LAST:event_RadioButtonAtmPressureActionPerformed

    private void RadioButtonPluviosityActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RadioButtonPluviosityActionPerformed
        
        HistoricControl frame = new HistoricControl(3);
        RadioButtonTemperature.setEnabled(true);
        RadioButtonAtmPressure.setEnabled(true);
        RadioButtonPluviosity.setEnabled(false);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }//GEN-LAST:event_RadioButtonPluviosityActionPerformed

    /**
     * @param args the command line arguments
     */
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JRadioButton RadioButtonAtmPressure;
    private javax.swing.JRadioButton RadioButtonPluviosity;
    private javax.swing.JRadioButton RadioButtonTemperature;
    private javax.swing.JButton ReturnButton;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    // End of variables declaration//GEN-END:variables
}
